#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024/4/29 14:55
# @Author  : 王凯
# @File    : demo.py
# @Project : scrapy_spider
import jpype

jvmPath = jpype.getDefaultJVMPath()
path = r"pdd-anti-token-jar-with-dependencies.jar"  # 对应jar地址
jpype.startJVM(jvmPath, "-Dfile.encoding=utf-8", "-Djava.class.path=" + path)
signature = jpype.JClass("pdd.anti.token.PddAntiToken").getToken(["1714113984212", "eDX09CJK"])
print("signature =>", signature)
jpype.shutdownJVM()  # 关闭JVM（注意，必须在所有子线程结束后再关闭，不用子线程调用加密方法会失败）
